/*
 * GameLogicFabric.h
 *
 *  Created on: 03.02.2013
 *      Author: Kirill Blinov
 *   Copyright: LGPL
 */

#ifndef GAMELOGICFABRIC_H_
#define GAMELOGICFABRIC_H_

#include "IGameLogic.h"

class GameLogicFabric
{
private:

	static IGameLogic* ActiveLogicInstance;

private:
	GameLogicFabric(){};
	virtual ~GameLogicFabric(){};

public:

	/*
	 * Creates an instance of game logic specific for current project
	 */
	static IGameLogic* CreateGameLogic( CGameWorld::CGameWorldUnitIterator* UnitIterator,
                                        std::vector<CGameCamera*> MainCamera );

	/*
	 * Destroys a game logic instance has been created before
	 */
	void DestroyGameLogic( IGameLogic* GameLogic )
	{
		assert( GameLogic == ActiveLogicInstance );
		delete GameLogic;
		ActiveLogicInstance = NULL;
	}

};

#endif /* GAMELOGICFABRIC_H_ */
